Move the VFL error domain to a public header
authorEmmanuele Bassi <ebassi@gnome.org>
Sun, 30 Jun 2019 23:47:44 +0000 (00:47 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Sun, 30 Jun 2019 23:48:48 +0000 (00:48 +0100)
Since the public API will use it to fill out GErrors, it needs to be
publicly available.

gtk/gtkconstraintlayout.c
gtk/gtkconstraintlayout.h
gtk/gtkconstraintvflparser.c
gtk/gtkconstraintvflparserprivate.h
gtk/gtkenums.h

index 658298d35efce3d5f40c8d7db07362d8396fcf95..aacc55dcde5d265fa222bd10ccad14eb9994d97e 100644 (file)
@@ -1214,6 +1214,12 @@ attribute_from_name (const char *name)
   return GTK_CONSTRAINT_ATTRIBUTE_NONE;
 }
 
+GQuark
+gtk_constraint_vfl_parser_error_quark (void)
+{
+  return g_quark_from_static_string ("gtk-constraint-vfl-parser-error-quark");
+}
+
 /**
  * gtk_constraint_layout_add_constraints_from_descriptionv: (rename-to gtk_constraint_layout_add_constraints_from_description)
  * @layout: a #GtkConstraintLayout
index 3297662dea6003358de81af8315a0f433b7ed2d3..b57404cb3f0e4a398db45d043c30fa290541c5d4 100644 (file)
@@ -26,6 +26,7 @@ G_BEGIN_DECLS
 
 #define GTK_TYPE_CONSTRAINT_LAYOUT (gtk_constraint_layout_get_type ())
 #define GTK_TYPE_CONSTRAINT_LAYOUT_CHILD (gtk_constraint_layout_child_get_type ())
+#define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ())
 
 /**
  * GtkConstraintLayoutChild:
@@ -44,6 +45,9 @@ G_DECLARE_FINAL_TYPE (GtkConstraintLayoutChild, gtk_constraint_layout_child, GTK
 GDK_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (GtkConstraintLayout, gtk_constraint_layout, GTK, CONSTRAINT_LAYOUT, GtkLayoutManager)
 
+GDK_AVAILABLE_IN_ALL
+GQuark                  gtk_constraint_vfl_parser_error_quark   (void);
+
 GDK_AVAILABLE_IN_ALL
 GtkLayoutManager *      gtk_constraint_layout_new               (void);
 
index 0d4678499107aa6c9d8f5c103591f681adef1ac0..79be0b0037d4e524ffcd2904ba808544f2678634 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include "gtkconstraintvflparserprivate.h"
+#include "gtkenums.h"
 
 #include <string.h>
 
@@ -101,11 +102,11 @@ struct _GtkConstraintVflParser
   VflView *views;
 };
 
-GQuark
-gtk_constraint_vfl_parser_error_quark (void)
-{
-  return g_quark_from_static_string ("gtk-constraint-vfl-parser-error-quark");
-}
+/* NOTE: These two symbols are defined in gtkconstraintlayout.h, but we
+ * cannot include that header here
+ */
+#define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ())
+GQuark gtk_constraint_vfl_parser_error_quark (void);
 
 GtkConstraintVflParser *
 gtk_constraint_vfl_parser_new (void)
index a89b4748935ff11f2dc977b8da4019e06dc76d99..dd214f5049a48c6886addb1e56be7fe4f938fbe6 100644 (file)
 
 G_BEGIN_DECLS
 
-#define GTK_CONSTRAINT_VFL_PARSER_ERROR (gtk_constraint_vfl_parser_error_quark ())
-
-typedef enum {
-  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL,
-  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE,
-  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW,
-  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC,
-  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY,
-  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION
-} VflError;
-
 typedef struct _GtkConstraintVflParser       GtkConstraintVflParser;
 
 typedef struct {
@@ -49,8 +38,6 @@ typedef struct {
   double strength;
 } GtkConstraintVfl;
 
-GQuark gtk_constraint_vfl_parser_error_quark (void);
-
 GtkConstraintVflParser *
 gtk_constraint_vfl_parser_new (void);
 
index e5ea3311728ebeb7c1e33cd62b53747cf0218942..6c226382f49c6cd6eff88c3140867e9b049ed4a2 100644 (file)
@@ -1127,4 +1127,24 @@ typedef enum {
   GTK_CONSTRAINT_ATTRIBUTE_BASELINE
 } GtkConstraintAttribute;
 
+/**
+ * GtkConstraintVflParserError:
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL: Invalid or unknown symbol
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: Invalid or unknown attribute
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: Invalid or unknown view
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: Invalid or unknown metric
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: Invalid or unknown priority
+ * @GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: Invalid or unknown relation
+ *
+ * Domain for VFL parsing errors.
+ */
+typedef enum {
+  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL,
+  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE,
+  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW,
+  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC,
+  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY,
+  GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION
+} GtkConstraintVflParserError;
+
 #endif /* __GTK_ENUMS_H__ */